#include "./test.h"
#include "../include/map.h"
#include "../include/pool.h"
#include "../include/line.h"

TEST(Map)
{
    Map map;
    Map_Init(&map, 32 * 32 * 32 * 32 * 8);

    for (int i = 0; i < 10000000; i++)
    {
        Map_Put(&map, TINTEGER(i), TINTEGER(i));
    }
    for (int i = 0; i < 10000000; i++)
    {
        assert(Map_Get(&map, TINTEGER(i)).value.integer == i);
    }
    for (int i = 0; i < 10000000; i++)
    {
        Map_Remove(&map, TINTEGER(i));
    }
    Map_Put(&map, TNULL, TINTEGER(1));
    TValue v = Map_Get(&map, TNULL);
    Delete_Map((Object *)&map);
}